package ntu.metaweb.result;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

import ntu.metaweb.storage.WebPageQuery;

@XStreamAlias("link")
public class NumberedPageRating {
	@XStreamAsAttribute
	@XStreamAlias("num")
	public int number;
	@XStreamAlias("averagerating")
	public double averageRating;
	@XStreamAlias("userrating")
	public double userRating;
	
	public NumberedPageRating(String user, WebPageQuery webpagequery, int number) {
		this.averageRating = webpagequery.getAverageRating();
		this.userRating = webpagequery.getUserRating(user);
		this.number = number;
	}
}
